<script setup lang="ts">
import { nextTick, onMounted, reactive, ref, watch } from "vue";
import {
  getRegistUnit,
  selectListAll,
  listProvince,
  getRegistUnitOut,
  selectListAllOut,
} from "@/services/newsApi.ts";
import type { FormRule } from "@/types/commonType.ts";
import { FormInstance, Message } from "@arco-design/web-vue";
import useFormSubmit from "@/hooks/useFormSubmit.ts";
import type { newsHelpEditType } from "@/types/newsType";
import { getOutURL, maskPhone } from "@/utils";

const props = defineProps({
  registUid: String,
  show: Number,
  link: String,
});
const projectInfo = ref([]);

const getDeclarationList = () => {
  if (props.link === "out") {
    getRegistUnitOut({ registUid: props.registUid })
      .then((res) => {
        projectInfo.value = res.data;
      })
      .finally(() => {
        visible.value = true;
        setTimeout(() => {
          loading.value = false;
        }, 300);
      });
  } else {
    getRegistUnit({ registUid: props.registUid })
      .then((res) => {
        projectInfo.value = res.data;
      })
      .finally(() => {
        visible.value = true;
        setTimeout(() => {
          loading.value = false;
        }, 300);
      });
  }
};

const formRef = ref<FormInstance>();

const loading = ref(false);

const drawer = ref<{
  showDialog: () => void;
  hideDialog: () => void;
}>();

const options = reactive({
  title: "",
  type: 0,
});

const handleClose = () => {
  visible.value = false;
};

const show = () => {
  loading.value = true;
  optionInit();
  options.type = 0;
  formRef.value?.clearValidate();
  projectInfo.value = [];
};

const visible = ref(false);
const tabsValue = ref("");
const tabsValue2 = ref("");

const getBaseURL = () => import.meta.env.VITE_API_BASE_URL;

// 图片回显
function getImage(src: string) {
  if (props.link === "out") {
    return getOutURL() + src;
  }
  return getBaseURL() + src;
}

const optionsList = reactive<{
  [key: string]: [];
}>({
  单位性质: [],
  数据资源: [],
  基础设施: [],
  场景应用: [],
  流通服务: [],
  安全治理: [],
  融资阶段: [],
  算力来源: [],
  存力来源: [],
  算法来源: [],
  企业规模: [],
});

// 回显
function getItem(key: string | boolean, id?: string | string[]) {
  let str = "";
  if (typeof key === "boolean") {
    if (key) {
      return "是";
    }
    return "否";
  }
  if (key === "true") {
    return "是";
  }
  if (key === "false") {
    return "否";
  }
  if (typeof id === "string") {
    optionsList[key].forEach((item) => {
      if (item.id === id) {
        // return item.itemText
        str = item.itemText;
      }
    });
  }
  if (Array.isArray(id)) {
    const strs = id.map((item) => {
      return optionsList[key].find((keys) => keys.id === item)?.itemText;
    });
    str = strs.join("，");
  }
  return str;
}

// 参数初始化
function optionInit() {
  if (props.link === "out") {
    selectListAllOut()
      .then((res) => {
        if (res.code === 200) {
          for (const key in optionsList) {
            const find = res.data.find((item) => item.dictCode === key);
            if (find) {
              optionsList[key] = find.dictItemList.filter(
                (item) => item.status !== 1
              );
            }
          }
        }
      })
      .finally(() => {
        console.log("第一次调用");
        getDeclarationList();
      });
  } else {
    selectListAll()
      .then((res) => {
        if (res.code === 200) {
          for (const key in optionsList) {
            const find = res.data.find((item) => item.dictCode === key);
            if (find) {
              optionsList[key] = find.dictItemList.filter(
                (item) => item.status !== 1
              );
            }
          }
        }
      })
      .finally(() => {
        console.log("第一次调用");
        getDeclarationList();
      });
  }
}

const currentYearMinus = (x: number) => {
  return new Date().getFullYear() - x;
};

defineExpose({
  show,
});
</script>

<template>
  <div v-if="props.show === 1 && visible">
    <a-empty v-if="projectInfo.length === 0" />
    <div v-else>
      <div
        v-if="loading"
        style="height: 700px;"
      >
        <div class="loading-overlay">
          <div class="loading-spinner"></div>
          <!-- <div class="loading-text">加载中...</div> -->
        </div>
      </div>

      <a-tabs
        v-model="tabsValue"
        v-else
      >
        <a-tab-pane
          v-for="(item,index) in projectInfo"
          :key="index"
        >
          <template #title>
            <icon-calendar /> 参赛单位{{ index+1 }}
          </template>

          <div style="height:650px;overflow: auto;padding-bottom: 20px;">
            <a-tabs v-model="tabsValue2">
              <a-tab-pane
                key="1"
                title="基本信息"
              >
                <a-descriptions
                  title=""
                  bordered
                  :column="2"
                >
                  <a-descriptions-item label="单位名称">
                    <p>{{ item.registUnit.unitName }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="统一社会信用代码">
                    <p>{{ item.registUnit.socialCreditCode }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="成立时间">
                    <p>{{ item.registUnit.establishmentDate }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="企业营业执照">
                    <!-- <img
                      :src="getImage(item.businessLicenseFile)"
                      alt=""
                      style="width: 100px;"
                    > -->

                    <a-image
                      :src="getImage(item.registUnit.businessLicenseFile)"
                      width="100"
                      :preview="true"
                    />

                  </a-descriptions-item>
                  <a-descriptions-item label="单位性质">
                    <p>{{ getItem('单位性质', item.registUnit.unitNature) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="企业规模">
                    <p>{{ getItem('企业规模', item.registUnit.enterpriseSize) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="是否央企子公司">
                    <p>{{ getItem(item.registUnit.hasCentralEnterpriseSub!) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="所在省">
                    <p>{{ item.registUnit.province }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="所在市">
                    <p>{{ item.registUnit.city }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="详细地址">
                    <p>{{ item.registUnit.address }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="单位联系人姓名">
                    <p>{{ item.registUnit.contactName }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item>
                    <template #label>
                      <span>单位联系人手机</span>
                    </template>
                    <p>{{ maskPhone(item.registUnit.contactPhone) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="职务">
                    <p>{{ item.registUnit.contactPosition }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="邮箱">
                    <p>{{ item.registUnit.contactEmail }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="单位简介">
                    <p>{{ item.registUnit.unitDescription }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="核心能力">
                    <p>{{ item.registUnit.coreCompetence }}</p>
                  </a-descriptions-item>

                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">营收（万元）</span>
                    </template>
                    <a-descriptions
                      :column="2"
                      bordered
                    >
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(1)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.revenueYear1 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(2)}}年：</span>
                        </template>

                        <span>{{ item.registUnit.revenueYear2 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(3)}}年：</span>
                        </template>

                        <span>{{ item.registUnit.revenueYear3 }}万元</span>
                      </a-descriptions-item>
                    </a-descriptions>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">利润（万元）</span>
                    </template>
                    <a-descriptions
                      bordered
                      :column="2"
                      size="small"
                    >
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(1)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear1 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(2)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear2 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(3)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear3 }}万元</span>
                      </a-descriptions-item>
                    </a-descriptions>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">{{currentYearMinus(1)}}年数据技术研发投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.techRdInvestYear1 }}万元</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">其中，AI投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.aiInvestYear1 }}万元</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="required-label">{{currentYearMinus(1)}}年获取外部数据的成本投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.externalDataCost2024 }}万元</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>

              <a-tab-pane
                key="2"
                title="数据开发利用"
              >
                <a-descriptions
                  bordered
                  :column="3"
                  size="small"
                >
                  <a-descriptions-item
                    :span="3"
                    style="width: 500px;"
                  >
                    <template #label>
                      <span class="required-label">数据资源</span>
                    </template>
                    <span>{{ getItem('数据资源', item.registUnit.dataType) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">基础设施</span>
                    </template>
                    <span>{{ getItem('基础设施', item.registUnit.infrastructure) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">场景应用</span>
                    </template>
                    <span>{{ getItem('场景应用', item.registUnit.scenarioApplication) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">流通服务</span>
                    </template>
                    <span>{{ getItem('流通服务', item.registUnit.circulationService) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">安全治理</span>
                    </template>
                    <span>{{ getItem('安全治理', item.registUnit.securityGovernance) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">标准化处理的数据占数据存储总量比例（%）</span>
                    </template>
                    <span>{{ item.registUnit.standardizedDataRatio }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">用于开发利用的数据占数据存储总量比例（%）</span>
                    </template>
                    <span>{{ item.registUnit.utilizedDataRatio }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">算力来源</span>
                    </template>
                    <span>{{ getItem('算力来源', item.registUnit.computingPowerSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">存力来源</span>
                    </template>
                    <span>{{ getItem('存力来源', item.registUnit.storageSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">算法来源</span>
                    </template>
                    <span>{{ getItem('算法来源', item.registUnit.algorithmSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">是否接入大模型</span>
                    </template>
                    <span>{{ getItem( item.registUnit.hasLargeModel!) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据产品数量：</span>
                    </template>
                    <span>{{ item.registUnit.dataProductCount }}个</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据服务数量</span>
                    </template>
                    <span>{{ item.registUnit.dataServiceCount }}个</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据资产入表金额（万元）：</span>
                    </template>
                    <span>{{ item.registUnit.dataAssetAmount }}万</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>

              <a-tab-pane
                key="3"
                title="融资情况"
              >
                <a-descriptions
                  bordered
                  :column="3"
                  size="small"
                >
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">融资阶段</span>
                    </template>
                    <span>{{ getItem('融资阶段', item.registUnit.financingStage) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">总融资额（万）</span>
                    </template>
                    <span>{{ item.registUnit.totalFinancingAmount }}万</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">主要投资方</span>
                    </template>
                    <span>{{ item.registUnit.mainInvestors }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="label">近期有融资需求</span>
                    </template>
                    <span>{{ getItem(item.registUnit.hasFinancingNeeds!) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="required-label">是否为参赛牵头单位</span>
                    </template>
                    <span>{{ getItem(item.registUnit.hasCompetitionLeadUnit!) }}</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>
            </a-tabs>
          </div>
        </a-tab-pane>

      </a-tabs>
    </div>
  </div>

  <a-modal
    v-else
    v-model:visible="visible"
    ref="drawer"
    title="参赛单位基本信息"
    width="80%"
  >
    <div>
      <a-empty v-if="projectInfo.length === 0" />
      <a-tabs
        v-model="tabsValue"
        v-else
      >
        <a-tab-pane
          v-for="(item,index) in projectInfo"
          :key="index"
        >
          <template #title>
            <icon-calendar /> 参赛单位{{ index+1 }}
          </template>

          <div style="height: 600px;overflow: auto;">
            <a-tabs v-model="tabsValue2">
              <a-tab-pane
                key="1"
                title="基本信息"
              >
                <a-descriptions
                  title=""
                  bordered
                  :column="2"
                >
                  <a-descriptions-item label="单位名称">
                    <p>{{ item.registUnit.unitName }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="统一社会信用代码">
                    <p>{{ item.registUnit.socialCreditCode }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="成立时间">
                    <p>{{ item.registUnit.establishmentDate }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="企业营业执照">
                    <!-- <img
                      :src="getImage(item.businessLicenseFile)"
                      alt=""
                      style="width: 100px;"
                    > -->
                    <a-image
                      :src="getImage(item.registUnit.businessLicenseFile)"
                      width="100"
                      :preview="true"
                    />
                  </a-descriptions-item>
                  <a-descriptions-item label="单位性质">
                    <p>{{ getItem('单位性质', item.registUnit.unitNature) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="企业规模">
                    <p>{{ getItem('企业规模', item.registUnit.enterpriseSize) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="是否央企子公司">
                    <p>{{ getItem(item.registUnit.hasCentralEnterpriseSub!) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="所在省">
                    <p>{{ item.registUnit.province }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="所在市">
                    <p>{{ item.registUnit.city }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="详细地址">
                    <p>{{ item.registUnit.address }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="单位联系人姓名">
                    <p>{{ item.registUnit.contactName }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="单位联系人手机">
                    <p>{{ maskPhone(item.registUnit.contactPhone) }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="职务">
                    <p>{{ item.registUnit.contactPosition }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="邮箱">
                    <p>{{ item.registUnit.contactEmail }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="单位简介">
                    <p>{{ item.registUnit.unitDescription }}</p>
                  </a-descriptions-item>
                  <a-descriptions-item label="核心能力">
                    <p>{{ item.registUnit.coreCompetence }}</p>
                  </a-descriptions-item>

                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">营收（万元）</span>
                    </template>
                    <a-descriptions
                      :column="2"
                      bordered
                    >
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(1)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.revenueYear1 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(2)}}年：</span>
                        </template>

                        <span>{{ item.registUnit.revenueYear2 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(3)}}年：</span>
                        </template>

                        <span>{{ item.registUnit.revenueYear3 }}万元</span>
                      </a-descriptions-item>
                    </a-descriptions>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">利润（万元）</span>
                    </template>
                    <a-descriptions
                      bordered
                      :column="2"
                      size="small"
                    >
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(1)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear1 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(2)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear2 }}万元</span>
                      </a-descriptions-item>
                      <a-descriptions-item :span="2">
                        <template #label>
                          <span class="required-label">{{currentYearMinus(3)}}年：</span>
                        </template>
                        <span>{{ item.registUnit.profitYear3 }}万元</span>
                      </a-descriptions-item>
                    </a-descriptions>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">{{currentYearMinus(1)}}年数据技术研发投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.techRdInvestYear1 }}万元</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="2">
                    <template #label>
                      <span class="required-label">其中，AI投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.aiInvestYear1 }}万元</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="required-label">{{currentYearMinus(1)}}年获取外部数据的成本投入（万元）</span>
                    </template>

                    <span>{{ item.registUnit.externalDataCost2024 }}万元</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>

              <a-tab-pane
                key="2"
                title="数据开发利用"
              >
                <a-descriptions
                  bordered
                  :column="3"
                  size="small"
                >
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据资源</span>
                    </template>
                    <span>{{ getItem('数据资源', item.registUnit.dataType) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">基础设施</span>
                    </template>
                    <span>{{ getItem('基础设施', item.registUnit.infrastructure) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">场景应用</span>
                    </template>
                    <span>{{ getItem('场景应用', item.registUnit.scenarioApplication) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">流通服务</span>
                    </template>
                    <span>{{ getItem('流通服务', item.registUnit.circulationService) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">安全治理</span>
                    </template>
                    <span>{{ getItem('安全治理', item.registUnit.securityGovernance) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">标准化处理的数据占数据存储总量比例（%）</span>
                    </template>
                    <span>{{ item.registUnit.standardizedDataRatio }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">用于开发利用的数据占数据存储总量比例（%）</span>
                    </template>
                    <span>{{ item.registUnit.utilizedDataRatio }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">算力来源</span>
                    </template>
                    <span>{{ getItem('算力来源', item.registUnit.computingPowerSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">存力来源</span>
                    </template>
                    <span>{{ getItem('存力来源', item.registUnit.storageSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">算法来源</span>
                    </template>
                    <span>{{ getItem('算法来源', item.registUnit.algorithmSource) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">是否接入大模型</span>
                    </template>
                    <span>{{ getItem( item.registUnit.hasLargeModel!) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据产品数量：</span>
                    </template>
                    <span>{{ item.registUnit.dataProductCount }}个</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据服务数量</span>
                    </template>
                    <span>{{ item.registUnit.dataServiceCount }}个</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="required-label">数据资产入表金额（万元）：</span>
                    </template>
                    <span>{{ item.registUnit.dataAssetAmount }}万</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>

              <a-tab-pane
                key="3"
                title="融资情况"
              >
                <a-descriptions
                  bordered
                  :column="3"
                  size="small"
                >
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">融资阶段</span>
                    </template>
                    <span>{{ getItem('融资阶段', item.registUnit.financingStage) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">总融资额（万）</span>
                    </template>
                    <span>{{ item.registUnit.totalFinancingAmount }}万</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="3">
                    <template #label>
                      <span class="label">主要投资方</span>
                    </template>
                    <span>{{ item.registUnit.mainInvestors }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="label">近期有融资需求</span>
                    </template>
                    <span>{{ getItem(item.registUnit.hasFinancingNeeds!) }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item :span="4">
                    <template #label>
                      <span class="required-label">是否为参赛牵头单位</span>
                    </template>
                    <span>{{ getItem(item.registUnit.hasCompetitionLeadUnit!) }}</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-tab-pane>
            </a-tabs>
          </div>
        </a-tab-pane>

      </a-tabs>
    </div>

    <template #footer>
      <a-button @click="handleClose">
        关闭
      </a-button>
    </template>
  </a-modal>
</template>

<style scoped lang="scss">
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-text {
  font-size: 13px;
  color: #333;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

:deep(
    .arco-descriptions-size-small.arco-descriptions-border
      .arco-descriptions-item-label-block
  ) {
  padding: 12px 20px;
}

sup {
  color: #f5222d;
}
</style>
